extends Base1
@onready var player:CharacterBody2D=$"../.."
@onready var ani_spite:AnimatedSprite2D=$"../../AnimatedSprite2D"

func enter():
	ani_spite.play("Idle")
	pass

func do():
	var direction := Input.get_vector("左", "右", "上", "下")
	direction = direction.normalized()  # 确保方向向量长度为1，保持速度一致

	if not direction==Vector2(0,0):
		get_parent().change_state(1)
	elif Input.is_action_just_released("parasite"):
		get_parent().change_state(3)
		return
	elif Input.is_action_just_released("attack"):
		get_parent().change_state(2)
		return
	player.velocity=Vector2(0,0)
	player.move_and_slide()

